 <!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script type="text/javascript">
			var item;
			var odiv;
			var jl
			window.onscroll=function(){
				odiv =document.getElementById('ww');
				var scoortop = document.documentElement.scrollTop|| document.body.scrollTop;
				jl =(document.documentElement.clientHeight-odiv.clientHeight)/2+scoortop;
				console.log(odiv.offsetTop);
				status(odiv,jl);
			}
			function status(){
				setInterval(function(){
					console.log(odiv);
						var seep = (jl-odiv.offsetTop)/4;
						odiv.style.top=odiv.offsetTop+seep+'px';
				},30)
			}
		</script>
		<style type="text/css">
			body{
				height: 3500px;
			}
			div{
				width: 50px;
				height: 50px;
				position: absolute;
			
				background-color:red ;
			}
		</style>
	</head>
	<body>
		<div class="ww" id="ww">
			
		</div>
	</body>
</html>
